import request from '@/config/axios'

/** dtu信息信息 */
export interface DtuInfo {
  id: number; // 数据id
  regId: string; // 设备注册id
  imei: string; // 设备imei
  areaCode: string; // 区域码
  addressCode: string; // 地址码
  dtuModel: string; // DTU型号
  dtuName: string; // DTU名称
}

// 查询用户分组列表
export const getDtuPage = async (params: any) => {
  return await request.get({ url: `/measure/dtu/page`, params })
}

// 查询dtu信息详情
export const getDtuInfo = async (id: number) => {
  return await request.get({ url: `/measure/dtu/get?id=` + id })
}

// 新增dtu信息
export const createDtuInfo = async (data: DtuInfo) => {
  return await request.post({ url: `/measure/dtu/create`, data })
}

// 修改dtu信息
export const updateDtuInfo = async (data: DtuInfo) => {
  return await request.put({ url: `/measure/dtu/update`, data })
}

// 删除dtu信息
export const deleteDtuInfo = async (id: number) => {
  return await request.delete({ url: `/measure/dtu/delete?id=` + id })
}

  /** 批量删除dtu信息 */
export const deleteDtuInfoList = async (ids: number[]) => {
  return await request.delete({ url: `/measure/dtu/deleteList?ids=${ids.join(',')}` })
}

  // 导出dtu信息 Excel
// export const exportDtuInfo = async (params) => {
//   return await request.download({ url: `/measure/dtu-info/export-excel`, params })
// }
